package com.automannn.dubbo.withSpringBoot;

import com.automannn.dubbo.withSpring.DubboRunWithSpringProvider;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration;
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.core.env.StandardEnvironment;

/**
 * @author chenkh
 * @time 2021/8/5
 */
@EnableDubbo(scanBasePackages = "com.automannn.dubbo.provider")
@SpringBootApplication(exclude = {JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class})
public class DubboRunWithSpringBootProvider {
    public static void main(String[] args) {
        new SpringApplicationBuilder()
                .sources(DubboRunWithSpringBootProvider.class)
                .web(WebApplicationType.NONE)
                .run(args);
        System.out.println("-----dubbo提供者端启动(with springBoot)-----");
//        synchronized (DubboRunWithSpringProvider.class){
//            try {
//                DubboRunWithSpringProvider.class.wait();
//            }catch (Exception e){
//
//            }
//        }
    }
}
